package com.neucloud.da.edgeside.config;

import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class StorageConfig {

    @Bean
    public MinioClient getClientInstance(@Value("${model.s3.accesskey}") String accessKey, @Value("${model.s3.secretkey}") String secretKey, @Value("${model.s3.endpoint}") String endPoint) {
        log.info("accessKey:{}, secretKey:{}, endPoint:{}", accessKey, secretKey, endPoint);
        return MinioClient.builder()
                .credentials(accessKey,secretKey)
                .endpoint(endPoint)
                .build();
    }
}
